import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
// import Aside from '@/views/aside'
// import { component } from 'vue/types/umd'
// import { Aside } from 'element-ui'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '/',
    redirect: '/Login'
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home
  }
  // {
  //   path: "/Mess",
  //   name: "Mess",
  //   meta: {
  //     types: "TabBar",
  //     keys: 2
  //   },
  //   component: () => import(/* webpackChunkName: "mess" */ "../views/Mess.vue"),
  //   redirect: "/Mess/SessionList",
  //   children: [
  //     {
  //       path: "SessionList",
  //       name: "SessionList",
  //       meta: {
  //         types: "TabBar",
  //         keys: 2
  //       },
  //       component: () =>
  //         import(
  //           /* webpackChunkName: "mess" */ "../components/Mess/SessionList.vue"
  //         )
  //     },
  //     {
  //       path: "Dynamic",
  //       name: "Dynamic",
  //       meta: {},
  //       component: () =>
  //         import(
  //           /* webpackChunkName: "mess" */ "../components/Mess/Dynamic.vue"
  //         )
  //     }
  //   ]
  // },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL, // 默认路由配置模式 在config里面配置
  routes
})

// 路由前置守卫
router.beforeEach((to, from, next) => {
  next()
})
// 路由后置守卫
router.afterEach((to, from) => {})

export default router
